package edu.zut.cs.network.exercise.practice.object;

public class MyPoint {
	
	double x;
	double y;
	
	public MyPoint() {
		this.x=0;
		this.y=0;
	}

	public MyPoint(double x, double y) {
		
		this.x = x;
		this.y = y;
	}

	public double getX() {
		return x;
	}

	public double getY() {
		return y;
	}
	
	public double distance(MyPoint secondPoint)
	{
		
		double s = (this.x-x)*(this.x-x)+(this.y-y)*(this.y-y);
		double s1 = Math.sqrt(s);
		return s1;
	}
	
	public double distance(MyPoint p1,MyPoint p2)
	{
		
		double s = (p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y);
		double s1 = Math.sqrt(s);
		return s1;
	}
	
}
